/**
 *  Copyright 2010 ShenYang voole Co. Ltd.
 *  All right reserved. 
 */
package com.dianning.service;

import java.util.List;

import com.dianning.bean.Info;
import com.dianning.bean.InfoExpand;
import com.dianning.bean.Visitor;
import com.dianning.comm.OrderObj;
import com.dianning.exception.DianningException;
import com.dianning.service.web.PageList;
import com.dianning.service.web.Pages;

/**
 * 功能描述:信息操作接口
 *
 * 创建日期 Apr 10, 2010
 *
 * @author zhangbaochao
 *
 * @version 1.0
 *
 */
public interface InfoService {
	
	/**
	 * 更新信息
	 * @param info
	 * @param infoExpands
	 * @return
	 */
	public Info updateInfo(Info info,List infoExpands);
	
	/**
	 * 更新置顶信息
	 */
	public void updateTopReserves();
	
	public void updateCityTopInfo();
	
	public void updateAreaTopInfo();
	
	public void updateCommendInfo();
	
	/**
	 * 保存信息
	 * @param info
	 * @param infoexpands
	 * @return Info
	 */
	public Info saveInfo(Info info,List infoExpands);
	
	
	/**
	 * 根据主键获取Info对象
	 * 
	 * @param id
	 * 			long
	 * @return Info
	 * 			Info对象
	 */
	public Info findInfoById(long id);
	
	/**
	 * 根据InfoID,Keyword获取InfoExpand对象
	 * @param infoId
	 * @param keyword
	 * @return InfoExpand
	 * 			InfoExpand对象
	 */
	public InfoExpand findInfoExpandByInfoIdKeyword(long infoId,String keyword);

	/**
	 * 获取Info对象列表
	 * 
	 * @param uid
	 * @param cid
	 * @param ccid
	 * @param areaId
	 * @param tradingareaId
	 * @param title
	 * @param validated
	 * @param status
	 * @param oo
	 * @param pages
	 * @return PageList
	 */
	public PageList findInfos(long uid,long cid,long ccid,long areaId,long tradingareaId,int isbiz,int validated,int status,int isprofile,String title,List wherein,OrderObj[] oo, Pages pages);
	
	/**
	 * 获取Info对象列表
	 * 
	 * @param id
	 * @param ccid
	 * @param validated
	 * @param status
	 * @param orderby
	 * @param ascOrDesc
	 * @param firstResult
	 * @param maxResults
	 * @return List
	 */
	public List findInfos(long id,long uid,long ccid,int validated,int status,int isprofile,String orderby, int ascOrDesc, int firstResult, int maxResults);
	
	/**
	 * 获取Info列表
	 * 
	 * @param orderby
	 *            String
	 * @param ascOrDesc
	 *            int
	 * @param firstResult
	 *            int
	 * @param maxResults
	 *            int
	 * @return List
	 * 			Info对象列表
	 */
	public List findInfos(long uid,long cid,long ccid,long areaId,long tradingareaId,int isbiz,int validated,int status,int isprofile,String title,List ids, OrderObj[] oo);
	
	/**
	 * @param ccid
	 * @param isCommend
	 * @return long
	 * 		Info个数
	 */
	public long getCommendInfoNum(long ccid,int isCommend);
	
	/**
	 * 根据频道代码获取信息个数
	 * @param code
	 * @return
	 */
	public long getInfoNumByCid(long cid,int validated);
}
